package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.StrategyContent;
import cn.wolfcode.trip.base.mapper.StrategyContentMapper;
import cn.wolfcode.trip.base.service.IStrategyContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StrategyContentServiceImpl implements IStrategyContentService{
    @Autowired
    private StrategyContentMapper strategyContentMapper;


    @Override
    public void saveOrUpdate(StrategyContent strategyContent) {
        if (strategyContent.getId() == null) {
            strategyContentMapper.insert(strategyContent);
        }else{
            strategyContentMapper.updateByPrimaryKey(strategyContent);
        }
    }

    /*@Override
    public PageInfo query(StrategyContentQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<StrategyContent> list = strategyContentMapper.selectForList(qo);
        return new PageInfo(list);
    }*/

    @Override
    public StrategyContent selectByDetailId(Long id) {

        return strategyContentMapper.selectByDetailId(id);
    }
}
